package com.shop2cn.iapi.couponmanage.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*改变优惠券批次时间Call
*FreeMaker Template自动生成代码
*/
public class ChangetimeinactivityCall extends YmatouBaseCall{
	private static String opurl ="api/sellermanage/changetimeinactivity";
	
	public ChangetimeinactivityCall() {
		super(EnvSetup.getSystemUrl("couponmanage_shop2cn_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	public int getTaskId() {
		int Code = 0;
		try {
			Code = new JSONObject(new JSONObject(getReturnData()).getString("data")).getInt("taskId");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}
	
	public String getMessage() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("message");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}
	
	public String getErrorCode() {
		String Code = null;
		try {
			Code =new JSONObject( new JSONObject(getReturnData()).getString("data")).getString("errorCode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}
}